<?php
/**
 * ERROR CODE 0300-0399
 *
 * */
class Check {
	
	private $error;
	public $freeFunctions = array();
	
	public function __construct() {
		if( empty($this->error) ) {
			if( !empty($GLOBALS['error']) ) {
				$this->error = $GLOBALS['error'];
			} else {
				$this->error = new Error();
				$GLOBALS['error'] = &$this->error;
			}
		}
	}
	public function dontCheckSymbols ( $symbols ) {
		if( empty($this->error) ) {
			if( !empty($GLOBALS['error']) ) {
				$this->error = $GLOBALS['error'];
			} else {
				$this->error = new Error();
				$GLOBALS['error'] = &$this->error;
			}
		}
	}
	public function dontCheck($functionName,$arg = array()){
		$this->freeFunctions[] = $functionName;
		if( !empty($arg) ) {
			$this->freeFunctions[$functionName] = $arg;
		}
	}
	public function superTrim( &$value , &$key ) {
		$patern = '([^\s0-9a-zA-Zа-яА-ЯաբգդեզէըթժիլխծկհձղճմյնշոչպջռսվտրցւփքևօֆԱԲԳԴԵԶԷԸԹԺԻԼԽԾԿՀՁՂՃՄՅՆՇՈՉՊՋՌՍՎՏՐՑՒՓՔՕՖ])';
		$value = preg_replace($patern,'',$value);
		$value = trim( $value );
		$key = preg_replace('([^0-9a-zA-Z_])','',$key);
		$key = trim( $key );
	}

}


?>